﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace FurnitureSystem
{
    public partial class frmView : Form
    {
        public frmView()
        {
            InitializeComponent();
        }

        private void frmView_Load(object sender, EventArgs e)
        {
            SqlConnection conn = connect.Getconect();
            conn.Open();
            string sql = "select staffname,Addr,Contact_no,Department from EmployeeDetail where staffid='" + frmManagerUser.staffid + "'";
            SqlCommand cmd = new SqlCommand(sql, conn);
            SqlDataReader sdr = cmd.ExecuteReader();
            while (sdr.Read()) {
                txtName.Text = sdr.GetString(0);
                txtAddress.Text = sdr.GetString(1);
                txtContact.Text = sdr.GetInt32(2).ToString();
                txtDepartment.Text = sdr.GetString(3);

            }
            

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            frmManagerUser fmu = new frmManagerUser();
            fmu.Show();
            this.Dispose();
        }

    }
}
